//相同商品，相同店号/Trait号，时间重叠商品不能提交，提示：存在重复提交的商品
var result_16 = JSON.parse('{"CODE":0, "ACTION":"","LEVEL":"", "MSG":"","DATA":"","RULE":"16"}');
var EFF_DATE = new Date(NEW_RETAIL_EFF_DATE);
var EXP_DATE = new Date(NEW_RETAIL_EXP_DATE);
function FindSameRetail(ITEM_NBR, ID, TRAIT_STORE_NBR, RETAIL_TYPE, NEW_RETAIL_EFF_DATE, NEW_RETAIL_EXP_DATE, NEW_RETAIL, JSON_ITEM_LIST) {
    for (var i = 0; i < JSON_ITEM_LIST.length; i++) {
        if (RetailIsNotNull(JSON_ITEM_LIST[i])
            && ITEM_NBR == JSON_ITEM_LIST[i].ITEM_NBR
            && ID != JSON_ITEM_LIST[i].ID
            && TRAIT_STORE_NBR == JSON_ITEM_LIST[i].TRAIT_STORE_NBR
            && isDateIntersection(EFF_DATE, EXP_DATE, new Date(JSON_ITEM_LIST[i].NEW_RETAIL_EFF_DATE), new Date(JSON_ITEM_LIST[i].NEW_RETAIL_EXP_DATE))) {
            return true;
        }
    }
    return false;
};

if (FindSameRetail(ITEM_NBR, ID, TRAIT_STORE_NBR, RETAIL_TYPE, NEW_RETAIL_EFF_DATE, NEW_RETAIL_EXP_DATE, NEW_RETAIL, JSON_ITEM_LIST)) {
    result_16.CODE = 2;
    result_16.ACTION = "CHECKING_REPORT";
    result_16.MSG = "存在重复提交的商品";
}
JSON.stringify(result_16);
